import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/ywx_limit.dart';
import 'package:app/src/manager/ywx_manager.dart';

///各个审核的小数点未审核个数
class YwxCount extends BaseBean {
  String? Contract = null; //合同审核
  String? Order = null; //订单审核
  String? ContractOem = null; //合同特殊设置审核
  String? Auditaddress = null; //送货地址审核
  String? OrderDJchek = null; //冻结解冻审核
  String? OrdersChangeFactory = null; //工厂更换审核
  String? DeliveryNotice = null; //发货审核
  String? PayFreeReturn = null; //退货审核
  String? Receipt = null; //开票审核
  String? PayNotice = null; //收款审核（确认收款）
  String? PayFree = null; //免款审核
  String? OtherWorkApplyDoList = null; //派工审核
  String? CarFreightRates = null; //外车运费审核
  String? GuaranteedReview = null; //保底审核
  String? WorkReview = null; //加班审核
  String? PercentageCheck = null; //提成审核
  String? ContractRoyaltyRateApplyCheck = null; //提成比例审核
  String? LoseApplySure = null; //报损审核
  String? MaterialReview = null; //五金领用审核
  String? GetPurDemandList = null; //原片请购单审核
  String? GetPurDemandListMT02 = null; //辅料请购单审核
  String? GetPurDemandListMT03 = null; //五金请购单审核
  String? GetPurOrder = null; //原片采购单审核
  String? GetPurOrderMT02 = null; //辅料采购单审核
  String? GetPurOrderMT03 = null; //五金采购单审核
  String? GetPurContract = null; //采购合同审核（原片采购合同审核）
  String? GetPurContractMT02 = null; //辅料采购合同审核
  String? GetPurContractMT03 = null; //五金采购合同审核
  String? GetLogisticsContract = null; //运输合同审核

  String? TicketCenter = null; //工单中心
  String? Myworkorder = null; //我的工单
  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    Contract = json["Contract"]?.toString() ?? "";
    Order = json["Order"]?.toString() ?? "";
    ContractOem = json["ContractOem"]?.toString() ?? "";
    Auditaddress = json["Auditaddress"]?.toString() ?? "";
    OrderDJchek = json["OrderDJchek"]?.toString() ?? "";
    OrdersChangeFactory = json["OrdersChangeFactory"]?.toString() ?? "";
    DeliveryNotice = json["DeliveryNotice"]?.toString() ?? "";
    PayFreeReturn = json["PayFreeReturn"]?.toString() ?? "";
    Receipt = json["Receipt"]?.toString() ?? "";
    PayNotice = json["PayNotice"]?.toString() ?? "";
    PayFree = json["PayFree"]?.toString() ?? "";
    OtherWorkApplyDoList = json["OtherWorkApplyDoList"]?.toString() ?? "";
    CarFreightRates = json["CarFreightRates"]?.toString() ?? "";
    GuaranteedReview = json["GuaranteedReview"]?.toString() ?? "";
    WorkReview = json["WorkReview"]?.toString() ?? "";
    PercentageCheck = json["PercentageCheck"]?.toString() ?? "";
    ContractRoyaltyRateApplyCheck =
        json["ContractRoyaltyRateApplyCheck"]?.toString() ?? "";
    LoseApplySure = json["LoseApplySure"]?.toString() ?? "";
    MaterialReview = json["MaterialReview"]?.toString() ?? "";
    GetPurDemandList = json["GetPurDemandList"]?.toString() ?? "";
    GetPurDemandListMT02 = json["GetPurDemandListMT02"]?.toString() ?? "";
    GetPurDemandListMT03 = json["GetPurDemandListMT03"]?.toString() ?? "";
    GetPurOrder = json["GetPurOrder"]?.toString() ?? "";
    GetPurOrderMT02 = json["GetPurOrderMT02"]?.toString() ?? "";
    GetPurOrderMT03 = json["GetPurOrderMT03"]?.toString() ?? "";
    GetPurContract = json["GetPurContract"]?.toString() ?? "";
    GetPurContractMT02 = json["GetPurContractMT02"]?.toString() ?? "";
    GetPurContractMT03 = json["GetPurContractMT03"]?.toString() ?? "";
    GetLogisticsContract = json["GetLogisticsContract"]?.toString() ?? "";

    TicketCenter = json["TicketCenter"]?.toString() ?? ""; //fixme 工单中心
    Myworkorder = json["Myworkorder"]?.toString() ?? ""; //fixme 我的工单
  }

  @override
  instance() {
    // TODO: implement instance
    return YwxCount();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    var map = <String, dynamic>{};
    map["Contract"] = Contract;
    map["Order"] = Order;
    map["ContractOem"] = ContractOem;
    map["Auditaddress"] = Auditaddress;
    map["OrderDJchek"] = OrderDJchek;
    map["OrdersChangeFactory"] = OrdersChangeFactory;
    map["DeliveryNotice"] = DeliveryNotice;
    map["PayFreeReturn"] = PayFreeReturn;
    map["Receipt"] = Receipt;
    map["PayNotice"] = PayNotice;
    map["PayFree"] = PayFree;
    map["OtherWorkApplyDoList"] = OtherWorkApplyDoList;
    map["CarFreightRates"] = CarFreightRates;
    map["GuaranteedReview"] = GuaranteedReview;
    map["WorkReview"] = WorkReview;
    map["PercentageCheck"] = PercentageCheck;
    map["ContractRoyaltyRateApplyCheck"] = ContractRoyaltyRateApplyCheck;
    map["LoseApplySure"] = LoseApplySure;
    map["MaterialReview"] = MaterialReview;
    map["GetPurDemandList"] = GetPurDemandList;
    map["GetPurDemandListMT02"] = GetPurDemandListMT02;
    map["GetPurDemandListMT03"] = GetPurDemandListMT03;
    map["GetPurOrder"] = GetPurOrder;
    map["GetPurOrderMT02"] = GetPurOrderMT02;
    map["GetPurOrderMT03"] = GetPurOrderMT03;
    map["GetPurContract"] = GetPurContract;
    map["GetPurContractMT02"] = GetPurContractMT02;
    map["GetPurContractMT03"] = GetPurContractMT03;
    map["GetLogisticsContract"] = GetLogisticsContract;
    map["TicketCenter"] = TicketCenter;
    map["Myworkorder"] = Myworkorder;
    return map;
  }

  ///根据类型，获取未读审核消息个数。
  String? getNum(String? reviewType) {
    String? content = null;
    if (StringUtils.isEmpty(reviewType)) {
      return content;
    }
    if (reviewType == ReviewType.Contract) {
      content = Contract; //合同审核
    } else if (reviewType == ReviewType.Order) {
      content = Order; //订单审核
    } else if (reviewType == ReviewType.ContractOem) {
      content = ContractOem; //合同特殊设置审核
    } else if (reviewType == ReviewType.Auditaddress) {
      content = Auditaddress; //送货地址审核
    } else if (reviewType == ReviewType.OrderDJchek) {
      content = OrderDJchek; //冻结解冻审核
    } else if (reviewType == ReviewType.OrdersChangeFactory) {
      content = OrdersChangeFactory; //工厂更换审核
    } else if (reviewType == ReviewType.DeliveryNotice) {
      content = DeliveryNotice; //发货审核
    } else if (reviewType == ReviewType.PayFreeGoodReturn) {
      content = PayFreeReturn; //退货审核
    } else if (reviewType == ReviewType.ReceiptApply) {
      content = Receipt; //开票审核
    } else if (reviewType == ReviewType.Paynotice) {
      content = PayNotice; //确认收款
    } else if (reviewType == ReviewType.PayFree) {
      content = PayFree; //免款审核
    } else if (reviewType == ReviewType.OtherWorkApplyDoList) {
      content = OtherWorkApplyDoList; //派工审核
    } else if (reviewType == ReviewType.CarFreightRates) {
      content = CarFreightRates; //外车运费审核
    } else if (reviewType == ReviewType.GuaranteedReview) {
      content = GuaranteedReview; //保底审核
    } else if (reviewType == ReviewType.WorkReview) {
      content = WorkReview; //加班审核
    } else if (reviewType == ReviewType.PercentageCheck) {
      content = PercentageCheck; //提成审核
    } else if (reviewType == ReviewType.ContractRoyaltyRateApplyCheck) {
      content = ContractRoyaltyRateApplyCheck; //提成比例审核
    } else if (reviewType == ReviewType.LoseApplySure) {
      content = LoseApplySure; //报损审核
    } else if (reviewType == ReviewType.MaterialReview) {
      content = MaterialReview; //五金领用审核
    } else if (reviewType == ReviewType.GetPurDemandList) {
      content = GetPurDemandList; //原片请购单审核
    } else if (reviewType == ReviewType.GetPurDemandListMT02) {
      content = GetPurDemandListMT02; //辅料请购单审核
    } else if (reviewType == ReviewType.GetPurDemandListMT03) {
      content = GetPurDemandListMT03; //五金请购单审核
    } else if (reviewType == ReviewType.GetPurOrder) {
      content = GetPurOrder; //原片采购单审核
    } else if (reviewType == ReviewType.GetPurOrderMT02) {
      content = GetPurOrderMT02; //辅料采购单审核
    } else if (reviewType == ReviewType.GetPurOrderMT03) {
      content = GetPurOrderMT03; //五金采购单审核
    } else if (reviewType == ReviewType.GetPurContract) {
      content = GetPurContract; //采购合同审核(原片)
    } else if (reviewType == ReviewType.GetPurContractMT02) {
      content = GetPurContractMT02; //辅料采购合同审核
    } else if (reviewType == ReviewType.GetPurContractMT03) {
      content = GetPurContractMT03; //五金采购合同审核
    } else if (reviewType == ReviewType.GetLogisticsContract) {
      content = GetLogisticsContract; //运输合同审核
    } else if (reviewType == ReviewType.TicketCenter) {
      content = TicketCenter; //工单中心
    }else if (reviewType == ReviewType.Myworkorder) {
      content = Myworkorder; //我的工单
    }
    return content;
  }

  static int allNum = 0;

  ///获取消息总数
  String? getAllNum(BuildContext context, {bool typeName = false}) {
    bool isShowLog = false;
    var all = 0;
    String content = "";
    try {
      if (YwxIdManager.get1H0001_1()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(Contract)) {
          all += int.parse(Contract!); //合同审核
        }
        // if (!StringUtils.isEmptyOrZero(Contract)) {
        //   content +=
        //       "${AppStrings.of(context).contractReview}：$Contract"; //合同审核
        // }
        content =
            getContent(content, AppStrings.of(context).Contract, Contract);
        //print("进来了$content");
        if (isShowLog) {
          print("合同审核：$Contract,总数：$all");
        }
      }
      if (YwxIdManager.get2N4004_9()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(Order)) {
          all += int.parse(Order!); //订单审核
        }
        // if (!StringUtils.isEmptyOrZero(Order)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content += "${AppStrings.of(context).Order}：$Order"; //订单审核
        // }
        content = getContent(content, AppStrings.of(context).Order, Order);
        if (isShowLog) {
          print("订单审核：$Order,总数：$all");
        }
      }
      if (YwxIdManager.get3N4018()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(Auditaddress)) {
          all += int.parse(Auditaddress!); //送货地址审核
        }
        // if (!StringUtils.isEmptyOrZero(Auditaddress)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).Auditaddress}：$Auditaddress"; //送货地址审核
        // }
        content = getContent(
            content, AppStrings.of(context).Auditaddress, Auditaddress);
        if (isShowLog) {
          print("送货地址审核：$Auditaddress,总数：$all");
        }
      }
      if (YwxIdManager.get4N4016()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(ContractOem)) {
          all += int.parse(ContractOem!); //合同特殊设置
        }
        // if (!StringUtils.isEmptyOrZero(ContractOem)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).ContractOem}：$ContractOem"; //合同特殊设置
        // }
        content = getContent(
            content, AppStrings.of(context).ContractOem, ContractOem);
        if (isShowLog) {
          print("合同特殊设置：$ContractOem,总数：$all");
        }
      }
      if (YwxIdManager.get5N4021_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(OrderDJchek)) {
          all += int.parse(OrderDJchek!); //冻结解冻审核
        }
        // if (!StringUtils.isEmptyOrZero(OrderDJchek)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).OrderDJchek}：$OrderDJchek"; //冻结解冻审核
        // }
        content = getContent(
            content, AppStrings.of(context).OrderDJchek, OrderDJchek);
        if (isShowLog) {
          print("冻结解冻审核：$OrderDJchek,总数：$all");
        }
      }
      if (YwxIdManager.get6N4025_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(OrdersChangeFactory)) {
          all += int.parse(OrdersChangeFactory!); //工厂更换审核
        }
        // if (!StringUtils.isEmptyOrZero(OrdersChangeFactory)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).OrdersChangeFactory}：$OrdersChangeFactory"; //工厂更换审核
        // }
        content = getContent(content,
            AppStrings.of(context).OrdersChangeFactory, OrdersChangeFactory);
        if (isShowLog) {
          print("工厂更换审核：$OrdersChangeFactory,总数：$all");
        }
      }
      if (YwxIdManager.get7N6024_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(DeliveryNotice)) {
          all += int.parse(DeliveryNotice!); //发货审核
        }
        // if (!StringUtils.isEmptyOrZero(DeliveryNotice)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).DeliveryNotice}：$DeliveryNotice"; //发货审核
        // }
        content = getContent(
            content, AppStrings.of(context).DeliveryNotice, DeliveryNotice);
        if (isShowLog) {
          print("发货审核：$DeliveryNotice,总数：$all");
        }
      }
      if (YwxIdManager.get8N6027_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(PayFreeReturn)) {
          all += int.parse(PayFreeReturn!); //退货审核
        }
        // if (!StringUtils.isEmptyOrZero(PayFreeReturn)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).PayFreeGoodReturn}：$PayFreeReturn"; //退货审核
        // }
        content = getContent(
            content, AppStrings.of(context).PayFreeGoodReturn, PayFreeReturn);
        if (isShowLog) {
          print("退货审核：$PayFreeReturn,总数：$all");
        }
      }
      if (YwxIdManager.get9N6033_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(Receipt)) {
          all += int.parse(Receipt!); //开票审核
        }
        // if (!StringUtils.isEmptyOrZero(Receipt)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content += "${AppStrings.of(context).ReceiptApply}：$Receipt"; //开票审核
        // }
        content =
            getContent(content, AppStrings.of(context).ReceiptApply, Receipt);
        if (isShowLog) {
          print("开票审核：$Receipt,总数：$all");
        }
      }
      if (YwxIdManager.get10N6036_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(PayNotice)) {
          all += int.parse(PayNotice!); //确认收款
        }
        // if (!StringUtils.isEmptyOrZero(PayNotice)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content += "${AppStrings.of(context).Paynotice}：$PayNotice"; //确认收款
        // }
        content =
            getContent(content, AppStrings.of(context).Paynotice, PayNotice);
        if (isShowLog) {
          print("确认收款：$PayNotice,总数：$all");
        }
      }
      if (YwxIdManager.get11N6039_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(PayFree)) {
          all += int.parse(PayFree!); //免款审核
        }
        // if (!StringUtils.isEmptyOrZero(PayFree)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content += "${AppStrings.of(context).PayFree}：$PayFree"; //免款审核
        // }
        content = getContent(content, AppStrings.of(context).PayFree, PayFree);
        if (isShowLog) {
          print("免款审核：$PayFree,总数：$all");
        }
      }
      if (YwxIdManager.get12H0002_1()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(OtherWorkApplyDoList)) {
          all += int.parse(OtherWorkApplyDoList!); //派工审核
        }
        // if (!StringUtils.isEmptyOrZero(OtherWorkApplyDoList)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).Dispatchingaudit}：$OtherWorkApplyDoList"; //派工审核
        // }
        content = getContent(content, AppStrings.of(context).Dispatchingaudit,
            OtherWorkApplyDoList);
        if (isShowLog) {
          print("派工审核：$OtherWorkApplyDoList,总数：$all");
        }
      }
      if (YwxIdManager.get13N6064()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(CarFreightRates)) {
          all += int.parse(CarFreightRates!); //外车运费审核
        }
        // if (!StringUtils.isEmptyOrZero(CarFreightRates)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).CarFreightRates}：$CarFreightRates"; //外车运费审核
        // }
        content = getContent(
            content, AppStrings.of(context).CarFreightRates, CarFreightRates);
        if (isShowLog) {
          print("外车运费审核：$CarFreightRates,总数：$all");
        }
      }
      if (YwxIdManager.get14H0003_2()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GuaranteedReview)) {
          all += int.parse(GuaranteedReview!); //保底审核
        }
        // if (!StringUtils.isEmptyOrZero(GuaranteedReview)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content +=
        //       "${AppStrings.of(context).GuaranteedReview}：$GuaranteedReview"; //保底审核
        // }
        content = getContent(
            content, AppStrings.of(context).GuaranteedReview, GuaranteedReview);
        if (isShowLog) {
          print("保底审核：$GuaranteedReview,总数：$all");
        }
      }
      if (YwxIdManager.get15RS2600()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(WorkReview)) {
          all += int.parse(WorkReview!); //加班审核
        }
        // if (!StringUtils.isEmptyOrZero(WorkReview)) {
        //   if (StringUtils.isNotEmpty(content)) {
        //     content += ",";
        //   }
        //   content += "${AppStrings.of(context).WorkReview}：$WorkReview"; //加班审核
        // }
        content =
            getContent(content, AppStrings.of(context).WorkReview, WorkReview);
        if (isShowLog) {
          print("加班审核：$WorkReview,总数：$all");
        }
      }
      if (isShowLog) {
        print("提成审核权限：${YwxIdManager.getN6016()?.isHasLimit()}");
      }
      if (YwxIdManager.getN6016()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(PercentageCheck)) {
          all += int.parse(PercentageCheck!); //提成审核
        }
        content = getContent(
            content, AppStrings.of(context).PercentageCheck, PercentageCheck);
        if (isShowLog) {
          print("提成审核：$PercentageCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN4029_0()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(ContractRoyaltyRateApplyCheck)) {
          all += int.parse(ContractRoyaltyRateApplyCheck!); //提成比例审核
        }
        content = getContent(
            content,
            AppStrings.of(context).ContractRoyaltyRateApplyCheck,
            ContractRoyaltyRateApplyCheck);
        if (isShowLog) {
          print("提成比例审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN6047()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(LoseApplySure)) {
          all += int.parse(LoseApplySure!); //报损审核
        }
        content = getContent(
            content, AppStrings.of(context).LoseApplySure, LoseApplySure);
        if (isShowLog) {
          print("报损审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN2030()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(MaterialReview)) {
          all += int.parse(MaterialReview!); //报损审核
        }
        content = getContent(
            content, AppStrings.of(context).HardwareApproval, MaterialReview);
        if (isShowLog) {
          print("报损审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN8001_3()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurDemandList)) {
          all += int.parse(GetPurDemandList!); //原片请购单审核
        }
        content = getContent(content,
            AppStrings.of(context).GetPurDemandListMT01, GetPurDemandList);
        if (isShowLog) {
          print("原片请购单审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN8001_3MT02()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurDemandListMT02)) {
          all += int.parse(GetPurDemandListMT02!); //辅料请购单审核
        }
        content = getContent(content,
            AppStrings.of(context).GetPurDemandListMT02, GetPurDemandListMT02);
        if (isShowLog) {
          print("辅料请购单审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN8001_3MT03()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurDemandListMT03)) {
          all += int.parse(GetPurDemandListMT03!); //五金请购单审核
        }
        content = getContent(content,
            AppStrings.of(context).GetPurDemandListMT03, GetPurDemandListMT03);
        if (isShowLog) {
          print("五金请购单审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN8002_3()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurOrder)) {
          all += int.parse(GetPurOrder!); //原片采购单审核
        }
        content =
            getContent(content, AppStrings.of(context).PurOrder, GetPurOrder);
        if (isShowLog) {
          print("原片采购单审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN8002_3MT02()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurOrderMT02)) {
          all += int.parse(GetPurOrderMT02!); //辅料采购单审核
        }
        content = getContent(
            content, AppStrings.of(context).PurOrderMT02, GetPurOrderMT02);
        if (isShowLog) {
          print("辅料采购单审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN8002_3MT03()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurOrderMT03)) {
          all += int.parse(GetPurOrderMT03!); //五金采购单审核
        }
        content = getContent(
            content, AppStrings.of(context).PurOrderMT03, GetPurOrderMT03);
        if (isShowLog) {
          print("五金采购单审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN605_1_3()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurContract)) {
          all += int.parse(GetPurContract!); //采购合同审核;(原片)
        }
        // content = getContent(
        //     content, AppStrings.of(context).GetPurContract, GetPurContract);//采购合同审核
        content = getContent(content, AppStrings.of(context).GetPurContractMT01,
            GetPurContract); //原片采购合同审核
        if (isShowLog) {
          print("原片采购合同审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN605_1_3MT02()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurContractMT02)) {
          all += int.parse(GetPurContractMT02!); //辅料采购合同审核
        }
        content = getContent(content, AppStrings.of(context).GetPurContractMT02,
            GetPurContractMT02);
        if (isShowLog) {
          print("辅料采购合同审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN605_1_3MT03()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetPurContractMT03)) {
          all += int.parse(GetPurContractMT03!); //五金采购合同审核
        }
        content = getContent(content, AppStrings.of(context).GetPurContractMT03,
            GetPurContractMT03);
        if (isShowLog) {
          print("五金采购合同审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
      if (YwxIdManager.getN605_8_3()?.isHasLimit() ?? false) {
        if (StringUtils.isNotEmpty(GetLogisticsContract)) {
          all += int.parse(GetLogisticsContract!); //运输合同审核
        }
        content = getContent(content,
            AppStrings.of(context).GetLogisticsContract, GetLogisticsContract);
        if (isShowLog) {
          print("报损审核：$ContractRoyaltyRateApplyCheck,总数：$all");
        }
      }
    } catch (e) {}
    allNum = all;
    if (isShowLog) {
      // print("提成审核：$PercentageCheck,总数：$all");
      // print("提成比例审核：$ContractRoyaltyRateApplyCheck,总数：$all");
      print("总审核数量：$all");
    }
    if (typeName) {
      if (all > 0) {
        return AppStrings.of(context).Num5 + ":$all\n$content"; //总待审核数量
      } else {
        return "";
      }
    } else {
      return all.toString();
    }
  }

  String getContent(String? content, String? key, String? value) {
    if (content != null) {
      if (!StringUtils.isEmptyOrZero(value)) {
        if (StringUtils.isNotEmpty(content)) {
          content += "，";
        }
        content += "$key:$value";
        //print("$content");
      }
      return content;
    }
    //print("空$content\t$key\t$value");
    return "";
  }
}
